package com.itheima.递归;

public class Test {
    public static void main(String[] args) {
        int res = getSum(100);
        System.out.println(res);
    }

    public static int getSum(int i) {
        if(i == 1){
            return 1;
        }else {
            return i+getSum(i-1);
        }
    }
}
